package com.kongyz.observer;

import com.kongyz.Subject;

/**
 * @author kongyz
 * @date 2018/7/3 21:44
 * @Description: 二进制
 */
public class BinaryObserver extends Observer {

    public BinaryObserver(Subject subject) {
        this.subject=subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println("二进制 :"+Integer.toBinaryString(subject.getState()));
    }
}
